<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title><?php echo $title;?></title>
<link href="<?php echo base_url(); ?>assets/public/css/reset.css" media="screen" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url(); ?>assets/public/css/style.css" media="screen" rel="stylesheet" type="text/css" />
<!--[if IE]>
<link href="css/ie.css" media="screen" rel="stylesheet" type="text/css">
<![endif]-->
<?php 
foreach($css_files as $file): ?>
	<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/public/js/jquery-1.4.4.min.js"></script>
<?php foreach($js_files as $file): ?>
<script type="text/javascript" src="<?php echo $file; ?>"></script>
<?php endforeach; ?>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/public/js/jquery-tipsy.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/public/js/jquery-custom.js"></script>
<script>
	$(function() {
		$( "#birthday" ).datepicker({ dateFormat: 'dd-mm-yy' });
	});
	</script>
</head>
<body>
<div class="shadow"></div>
<!-- .shadow -->
 <?php $this->load->view("common/header_view"); ?>
 <?php $this->load->view("common/sidebar_view",$sb);?>
<!-- BEGIN CONTENT -->
<div id="content">
    <div class="box-out">
    	<div class="box-in">
    		<div class="box-head"><h1><?php echo $content_title;?></h1></div>
                <div class="box-content" id="personnel_content">
                    <!--*********************Layout content********************************-->
                    <?php //print_r($cur); ?>
                    <?php if($suc!=null){ ?>
                    <div class="notification success">
    				<div class="messages"><?php echo $suc;?> <div class="close"><img alt="close" src="<?php echo base_url(); ?>assets/public/img/icon/close.png"></div></div>
    		    </div>
                    <?php } ?>
                    <?php echo form_error('name'); ?>
                    <?php echo form_error('username'); ?>
                    <?php echo form_error('password'); ?>
                    <?php echo form_error('email'); ?>
                    <div class="form">
                        <form method="post" action="<?php echo base_url(); ?>personnels/editprocess/<?php echo $cur[0]['id']; ?>">
                        <label>Họ tên</label>
                        <input type="text" id="name" name="name" value="<?php echo $cur[0]['name']; ?>" class="text medium"/>
                        <label>Mật khẩu</label>
                        <input type="password"   id="password" name="password" class="text medium"/>
                        <label>Nhập lại mật khẩu</label>
                        <input type="password" id="repass"  name="repass" class="text medium"/>
                        <label>Email</label>
                        <input type="text" id="email" name="email" value="<?php echo $cur[0]['email']; ?>" class="text medium"/>
                        <label>Địa chỉ</label>
                        <input type="text" id="address" name="address" value="<?php echo $cur[0]['address']; ?>" class="text medium"/>
                        <label>Ngày sinh</label>
                        <input type="text" id="birthday" name="birthday" value="<?php echo datephp($cur[0]['birthday']); ?>" class="text small"/>
                        <label>Giới tính</label>
                        <?php
                         echo fillDropdown(null,'text','sex',array(array('id'=>'1','value'=>'Nam'),array('id'=>'2','value'=>'Nữ')),'id','value',$cur[0]['sex']);
                        ?>
                         <label>Kĩ năng</label>
                        <input type="text" id="skill" name="skill" value="<?php echo $cur[0]['skill']; ?>" class="text medium"/>
                        <label>Lịch làm việc</label>
                         <?php 
                            echo fillDropdown(null,'text','calenderid',$cals,'id', 'name',$cur[0]['calenderid']);
                         ?>
                        <label>Lương cơ bản</label>
                        <input type="text" id="salary" name="salary" value="<?php echo $cur[0]['salary']; ?>" class="text medium"/>
                        <label>Lương ngoài giờ</label>
                        <input type="text" id="otsalary" name="otsalary" value="<?php echo $cur[0]['otsalary']; ?>" class="text medium"/>
                         <label>Đơn vị thời gian</label>
                         <?php 
                            echo fillDropdown(null,'text','timeunitid',$timeunits,'id', 'name',$cur[0]['timeunitid']);
                         ?>
                        <label>Quyền</label>
                        <?php
                         echo fillDropdown(null,'text','sex',array(array('id'=>'1','value'=>'Quản trị'),array('id'=>'2','value'=>'Nhân viên')),'id','value',$cur[0]['rule']);
                        ?><br/>
                        <input type="submit" name="btnupdate" class="submit" value="Lưu lại"/>
                        </form>
                    </div>
                    <!--*********************End layout content****************************-->
                </div>
        </div>
    </div>
</div>
<!--- END CONTENT --->

</body>
</html>